#include "StdAfx.h"
#include "error_list.h"

error_list error_list::m_s_instance;

error_list::error_list(void)
{
}

error_list::~error_list(void)
{
}

error_list& error_list::instance()
{
	return m_s_instance;
}

void error_list::log(wstring aStrFileName, wstring aMsg,  error_level aLvl/* = lvl_warning*/)
{
	error_item ei;
	ei.m_project	= L"main proj";
	ei.m_file		= aStrFileName;
	ei.m_desc		= aMsg;
	ei.m_lvl		= aLvl;

	wchar_t buf[1024];
	memset(buf, 0, sizeof(buf));

	SYSTEMTIME st;
	::GetLocalTime(&st);


	wsprintf(buf, L"%d:%d:%d.%d", st.wHour, st.wMinute, st.wSecond, st.wMilliseconds);
	ei.m_time		= buf;

	m_s_instance.add(ei);
}